package com.spms.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.spms.entity.Practice;
import com.spms.entity.PracticeDetail;
import com.spms.entity.Student;
import com.spms.entity.Teacher;
import com.spms.service.Impl.TeacherServiceImpl;

@RestController
public class TeacherController {
	@Autowired
	private TeacherServiceImpl teacherservice;
	
	@RequestMapping("/teacher/login")//登录
	public Teacher Login(String user_name, String user_password) {
		return teacherservice.Login(user_name, user_password);
	}
	
	@RequestMapping("/teacher/register")//注册
	public int Register(Teacher teacher) {
		return teacherservice.Register(teacher);
	}
	
	@RequestMapping("/teacher/insertpractice")//发布实践
	public int T_InsertPractice(String p_name, String address, String t_id, String start_time,String end_time) {
		return teacherservice.T_InsertPractice(p_name,address,t_id,start_time,end_time);
	}
	
	
	@RequestMapping("/teacher/updatepractice")//修改实践
	public int T_UpdatePractice(int p_id,String p_name, String address,int t_id,  String start_time,String end_time) {
		return teacherservice.T_UpdatePractice(p_id,p_name,address,t_id,start_time,end_time);
	}
	
	@RequestMapping("/teacher/deletepractice")//删除实践
	public int T_DeletePractice(int p_id,int t_id) {
		return teacherservice.T_DeletePractice(p_id,t_id);
	}
	
	@RequestMapping("/teacher/selectpractice")//查询自己负责的实践
	public List<Practice> T_SelectPractice(int t_id) {
		return teacherservice.T_SelectPractice(t_id);
	}
	
	
	@RequestMapping("/teacher/score")//老师打分
	public int T_score(int p_id,int s_id,int score,int t_id) {
		return teacherservice.T_score(p_id,s_id,score,t_id);
	}
	
	@RequestMapping("/teacher/findthink")//查询负责的活动学生日常
	public List<PracticeDetail> T_FindThink (int t_id) {
		return teacherservice.T_FindThink(t_id);
	}
	
	@RequestMapping("/teacher/deletethink")//删除学生日常
	public int DeleteThink(int t_id,int s_id,int p_id) {
		return teacherservice.DeleteThink(t_id, s_id, p_id);
	}
	
	@RequestMapping("/teacher/querystudent")//查询所选该项目的所有学生信息
	public List<Student> QuerySeletedStudent(int t_id,int p_id){
		return teacherservice.QuerySeletedStudent(t_id, p_id);
	}
}
